<?php if (!defined('TL_ROOT')) die('You cannot access this file directly!');

/**
 * Contao Open Source CMS
 * Copyright (C) 2005-2010 Leo Feyer
 *
 * Formerly known as TYPOlight Open Source CMS.
 *
 * This program is free software: you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation, either
 * version 3 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this program. If not, please visit the Free
 * Software Foundation website at <http://www.gnu.org/licenses/>.
 *
 * PHP version 5
 * @copyright  borowiakziehe KG 2012
 * @author     Joe Ray Gregory <jrgregory@borowiakziehe.de>
 * @package    easygooglefont_bz
 * @license    LGPL
 * @filesource
 */

// inject a new onload callback
$GLOBALS['TL_DCA']['tl_layout']['config']['onload_callback'][] = array('easygooglefont_bz', 'addJS');

class easygooglefont_bz extends tl_layout {
    /* adding css and relevant js files to the head of the backend
     *
     */
    public function addJS()
    {
        if($this->Input->get('act')) {
            $GLOBALS['TL_CSS'][] = 'system/modules/easygooglefont_bz/assets/css/easygooglefont_bz.css';
            $GLOBALS['TL_JAVASCRIPT'][] = 'plugins/mootools/1.4.5/mootools-more-jsonp.js';
            $GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/easygooglefont_bz/assets/js/easygooglefont_bz.js';
        }
    }
}